package com.spsy.pay.mq;

import com.spsy.common.core.utils.R;
import com.spsy.pay.constant.RabbitMqConstant;
import com.spsy.pay.constant.RabbitMqConstantAli;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;
import java.util.UUID;

/**
 * @Author: Kyrie Irving
 * @Date: 2025/9/23 17:09
 * @Description:
 **/
@RequestMapping("/AliMq")
@RestController
@Slf4j
public class RabbitmqAliSendController {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @PostMapping("/send")
    public R send(){
        CorrelationData correlationData = new CorrelationData("123123123");
        rabbitTemplate.convertAndSend(RabbitMqConstantAli.MQ_EXCHANGE,RabbitMqConstantAli.MQ_ROUTING,"朱龙博RabbirMq--测试",correlationData);
        return R.OK();
    }

}
